import { http } from '@/utils/http/axios';
import Qs from 'qs';
//获取数据统计
export function getNums(params) {
  return http.request({
    url: '/api/statistics/getNums',
    method: 'get',
    params,
  });
}
//添加灭火器
export function addManage(params) {
  return http.request({
    url: '/api/extinguisher/add',
    method: 'post',
    params,
  });
}
//根据单位id获取车间列表
export function getWorkshop(params) {
  return http.request({
    url: '/api/user/getWorkshop',
    method: 'get',
    params,
  });
}
//获取账户列表
export function getUserList(params) {
  return http.request({
    url: '/api/user/getList',
    method: 'get',
    params,
  });
}
// 添加账号
export function addUser(params) {
  return http.request({
    url: '/api/user/add',
    method: 'post',
    params,
  });
}
// 编辑账号
export function edit(params) {
  return http.request({
    url: '/api/user/edit',
    method: 'post',
    params,
  });
}
// 删除账号
export function delUser(params) {
  return http.request({
    url: '/api/user/del',
    method: 'post',
    params,
  });
}
//获取灭火器管理列表
export function getManageList(params) {
  return http.request({
    url: '/api/extinguisher/getManageList',
    method: 'get',
    params,
  });
}

//获取单位列表
export function getUnitsList(params) {
  return http.request({
    url: '/api/extinguisher/getUnitList',
    method: 'get',
    params,
  });
}

//获取车间列表
export function getWorkshopList(params) {
  return http.request({
    url: '/api/extinguisher/getWorkshopList',
    method: 'get',
    params,
  });
}
//获取所属单位列表
export function getList(params) {
  return http.request({
    url: '/api/user/getList',
    method: 'get',
    params,
  });
}
//获取操作日志
export function getlogList(params) {
  return http.request({
    url: '/api/operate_log/getList',
    method: 'get',
    params,
  });
}
// 获取临近维修期列表
export function getRepair(params) {
  return http.request({
    url: '/api/extinguisher/getRepair',
    method: 'get',
    params,
  });
}
// 获取报废提醒
export function getScrap(params) {
  return http.request({
    url: '/api/extinguisher/getScrap',
    method: 'get',
    params,
  });
}
// 获取过期未检修
export function getOverhaul(params) {
  return http.request({
    url: '/api/extinguisher/getOverhaul',
    method: 'get',
    params,
  });
}

// 用户禁用
export function userDisable(params) {
  return http.request({
    url: '/api/user/changeStatus',
    method: 'post',
    params,
  });
}
// 灭火器禁用
export function extinguisherChangeStatus(params) {
  return http.request({
    url: '/api/extinguisher/changeStatus',
    method: 'post',
    params,
  });
}
// 灭火器删除
export function extinguisherDel(params) {
  return http.request({
    url: '/api/extinguisher/del',
    method: 'get',
    params,
  });
}
// 灭火器编辑
export function extinguisherEdit(params) {
  return http.request({
    url: '/api/extinguisher/edit',
    method: 'post',
    params,
  });
}
// 用户生成空白二维码
export function getProduce(params){
  return http.request({
    url:'/api/extinguisher/produce',
    method:'post',
    params
  })
}
